﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WF.DAL;

namespace WF.Model
{
    /// <summary>
    /// WF_ApplyInstanceDetailEntity实体对象
    /// </summary>
    [Serializable]
    public class WF_ApplyInstanceDetailEntity : EntityBase<DAL.WF_ApplyInstanceDetail>
    {
        #region 构造函数

        public WF_ApplyInstanceDetailEntity() : base() { }
        public WF_ApplyInstanceDetailEntity(WF_ApplyInstanceDetail obj) : base(obj) { }
        #endregion

        #region 实现基类abstract属性

        public override string ID
        {
            get
            {
                return DbEntity.DetailID;
            }
            set
            {
                DbEntity.DetailID = value; this.SendPropertyChanged("DetailID");
            }
        }

        public override string DisplayName
        {
            get { return DbEntity.DetailID; }
        }

        #endregion

        #region  Public 属性

        public string ApplyID
        {
            get
            {
                return DbEntity.ApplyID;
            }
            set
            {
                DbEntity.ApplyID = value; this.SendPropertyChanged("ApplyID");
            }
        }

        public string BizDataID
        {
            get
            {
                return DbEntity.BizDataID;
            }
            set
            {
                DbEntity.BizDataID = value; this.SendPropertyChanged("BizDataID");
            }
        }
        #endregion

        /// <summary>
        /// 从数据库对象创建逻辑对象
        /// </summary>
        /// <param name="job">数据库对象</param>
        /// <returns>逻辑对象</returns>
        [Obsolete("请使用 new WF_ApplyInstanceDetailEntity(obj) ")]
        public static WF_ApplyInstanceDetailEntity CreateEntityFromDb(WF_ApplyInstanceDetail obj)
        {
            if (null == obj) return null;

            WF_ApplyInstanceDetailEntity ret = new WF_ApplyInstanceDetailEntity(obj);
            return ret;
        }

        //#region IEntity
        //public bool Add(WF.IDataLayer DataLayer)
        //{
        //    return DataLayer.Add(this);
        //}

        //public bool Update(WF.IDataLayer DataLayer)
        //{
        //    return DataLayer.Update(this);
        //}

        //public bool Delete(WF.IDataLayer DataLayer)
        //{
        //    return DataLayer.DeleteWF_ApplyInstanceDetailEntity(this.ID);
        //}

        //public bool GetDetail(WF.IDataLayer DataLayer)
        //{
        //    WF_ApplyInstanceDetailEntity result;
        //    if (!DataLayer.GetWF_ApplyInstanceDetailEntityById(this.ID, out result))
        //    {
        //        return false;
        //    }
        //    this._DALObject = result._DALObject;
        //    return true;
        //}
        //#endregion

    }
}
